import React, {Component} from 'react';
import {render} from 'react-dom';

import Modal from './wedgit/modal/modal'

class Button extends Component {
    constructor(props) {
        super(props);
        console.log(this)
        this.state = {
            name: '德玛西亚' 
        }
    }
    render() {
        console.log(this.state)
        return (
            <div>
                <input type="text" onChange={this.input.bind(this) } ref="input"/>
                <Modal name={this.state.name} ref="modal"/>
                <button type="button" onClick={this.say.bind(this) }>I am 安妮</button>
            </div>
        );
    }

    input() {
        this.setState({
            name: this.refs.input.value
        })
    }

    say() {
        this.setState({
            name: '安妮'
        })
        this.refs.modal.show();
    }
}


render(
    <Button/>,
    document.getElementById('alert')
);



import {Provider} from 'react-redux'
import App from './demo/app'
import configureStore from './demo/store/configureStore'

const store = configureStore()

render(
    <Provider store = {store} >
        <App />
    </Provider>,
    document.getElementById('root')
)

import Icon from './wedgit/icon/icon';

render(
    <Icon name="add" />,
    document.getElementById('icon')
)